package com.baseweb.webadmin.core.model.bvo;

import com.baseweb.webadmin.core.model.pojo.ByChannel;
import com.baseweb.webadmin.core.model.pojo.ByUserBizProduct;
import com.baseweb.webadmin.core.model.pojo.ByUserOrder;
import org.joda.time.DateTime;

import java.math.BigDecimal;
import java.util.List;

public class OrderWithDetailBvo {
    private Integer orderId;

    private BigDecimal deposit;

    private BigDecimal price;

    private DateTime createTime;

    private Integer status;

    private Integer payStatus;

    private Integer userStar;

    private OrderBvo order;

    private Integer userId;

    private Integer bizUserId;

//    private List<ByUserBizProduct> productList;
    private List<ByUserOrderDetailInfoBvo> productList;


    public static OrderWithDetailBvo copyFrom(OrderBvo orderBvo, List<ByUserOrderDetailInfoBvo> byUserBizProducts) {
        OrderWithDetailBvo bvo = new OrderWithDetailBvo();
        bvo.setOrder(orderBvo);
        bvo.setOrderId(orderBvo.getId());
        bvo.setDeposit(orderBvo.getDeposit());
        bvo.setPrice(orderBvo.getPrice());
        bvo.setCreateTime(orderBvo.getCreateTime());
        bvo.setProductList(byUserBizProducts);

        if (orderBvo.getUserStars() != null) {
            bvo.setUserStar(Integer.valueOf(orderBvo.getUserStars()));
        }

        bvo.setUserId(orderBvo.getUserId());
        bvo.setBizUserId(orderBvo.getBizUserId());

        bvo.setStatus(orderBvo.getStatus());
        bvo.setPayStatus(orderBvo.getPayStatus());
        return bvo;
    }

    public Integer getUserId() {
        return userId;
    }

    public void setUserId(Integer userId) {
        this.userId = userId;
    }

    public Integer getBizUserId() {
        return bizUserId;
    }

    public void setBizUserId(Integer bizUserId) {
        this.bizUserId = bizUserId;
    }

    public Integer getUserStar() {
        return userStar;
    }

    public void setUserStar(Integer userStar) {
        this.userStar = userStar;
    }

    public Integer getStatus() {
        return status;
    }

    public void setStatus(Integer status) {
        this.status = status;
    }

    public Integer getPayStatus() {
        return payStatus;
    }

    public void setPayStatus(Integer payStatus) {
        this.payStatus = payStatus;
    }

    public OrderBvo getOrder() {
        return order;
    }

    public void setOrder(OrderBvo order) {
        this.order = order;
    }

    public Integer getOrderId() {
        return orderId;
    }

    public void setOrderId(Integer orderId) {
        this.orderId = orderId;
    }

    public BigDecimal getDeposit() {
        return deposit;
    }

    public void setDeposit(BigDecimal deposit) {
        this.deposit = deposit;
    }

    public BigDecimal getPrice() {
        return price;
    }

    public void setPrice(BigDecimal price) {
        this.price = price;
    }

    public DateTime getCreateTime() {
        return createTime;
    }

    public void setCreateTime(DateTime createTime) {
        this.createTime = createTime;
    }

//    public List<ByUserBizProduct> getProductList() {
//        return productList;
//    }
//
//    public void setProductList(List<ByUserBizProduct> productList) {
//        this.productList = productList;
//    }


    public List<ByUserOrderDetailInfoBvo> getProductList() {
        return productList;
    }

    public void setProductList(List<ByUserOrderDetailInfoBvo> productList) {
        this.productList = productList;
    }
}
